/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/

#include <string.h>
#include <flgrCoreVector.h>
#include <flgrCoreDispatch.h>

#ifdef __SSE2__
#include <xmmintrin.h>
#include <emmintrin.h>
#endif

#include "flgrArithSSE2.h"

#define FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(instr,vtype,dtype,set_vec_const) \
  vtype r1,r2;								\
  vtype *psrc1 = (vtype*) data1->array;					\
  vtype *pdest = (vtype*) datdest->array;				\
  int j,c = (sizeof(vtype)*8)/data1->bps;				\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  r2=set_vec_const(*((dtype*) (vec_const->array)));			\
									\
  for(j=0;j<datdest->length;j+=c) {					\
    r1 = _mm_load_si128(psrc1);						\
    r1 = instr(r1,r2);							\
    _mm_store_si128(pdest,r1);						\
									\
    pdest++;psrc1++;							\
  }									\
									\
  return


#define FLGR_MACRO_ARITH_1D_DIADIC_SSE2(instr,vtype)	\
  vtype r1,r2;						\
  vtype *psrc1 = (vtype*) data1->array;			\
  vtype *psrc2 = (vtype*) data2->array;			\
  vtype *pdest = (vtype*) datdest->array;		\
  int j,c = (sizeof(vtype)*8)/data1->bps;		\
  int length = datdest->length*datdest->spp;		\
							\
  FLGR_DECLARE_FUNCTION;				\
							\
  for(j=0;j<length;j+=c) {				\
    r1 = _mm_load_si128(psrc1);				\
    r2 = _mm_load_si128(psrc2);				\
    r1 = instr(r1,r2);					\
    _mm_store_si128(pdest,r1);				\
							\
    pdest++;psrc1++;psrc2++;				\
  }							\
							\
  return




void flgr1d_arith_inf_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_inf_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_min_epu8,__m128i);
#endif
}
void flgr1d_arith_inf_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_min_epi16,__m128i);
#endif
}




void flgr1d_arith_sup_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_sup_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_max_epu8,__m128i);
#endif
}
void flgr1d_arith_sup_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_max_epi16,__m128i);
#endif
}



void flgr1d_arith_and_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_and_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_and_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_and_SSE2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_and_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_and_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}
void flgr1d_arith_and_SSE2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_and_si128,__m128i);
#endif
}



void flgr1d_arith_or_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_or_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_or_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_or_SSE2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_or_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_or_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}
void flgr1d_arith_or_SSE2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_or_si128,__m128i);
#endif
}



void flgr1d_arith_xor_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_xor_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_xor_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_xor_SSE2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_xor_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_xor_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_xor_SSE2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}



void flgr1d_arith_add_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_add_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_add_epi8,__m128i);
#endif
}
void flgr1d_arith_add_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_add_epi16,__m128i);
#endif
}
void flgr1d_arith_add_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_add_epi8,__m128i);
#endif
}
void flgr1d_arith_add_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_add_epi16,__m128i);
#endif
}



void flgr1d_arith_addsat_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_adds_epu8,__m128i);
#endif
}
void flgr1d_arith_addsat_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_adds_epu16,__m128i);
#endif
}
void flgr1d_arith_addsat_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_adds_epi16,__m128i);
#endif
}



void flgr1d_arith_sub_SSE2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_xor_si128,__m128i);
#endif
}
void flgr1d_arith_sub_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_sub_epi8,__m128i);
#endif
}
void flgr1d_arith_sub_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_sub_epi16,__m128i);
#endif
}
void flgr1d_arith_sub_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_sub_epi8,__m128i);
#endif
}
void flgr1d_arith_sub_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_sub_epi16,__m128i);
#endif
}



void flgr1d_arith_subsat_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_subs_epu8,__m128i);
#endif
}
void flgr1d_arith_subsat_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_subs_epu16,__m128i);
#endif
}
void flgr1d_arith_subsat_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_SSE2(_mm_subs_epi16,__m128i);
#endif
}







void flgr1d_arith_const_inf_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_min_epu8,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_inf_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_min_epi16,__m128i,fgINT16,_mm_set1_epi16);
#endif
}



void flgr1d_arith_const_sup_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_max_epu8,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_sup_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_max_epi16,__m128i,fgINT16,_mm_set1_epi16);
#endif
}




void flgr1d_arith_const_and_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_and_si128,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_and_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_and_si128,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_and_spp1_SSE2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_and_si128,__m128i,fgUINT32,_mm_set1_epi32);
#endif
}
void flgr1d_arith_const_and_spp1_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_and_si128,__m128i,fgINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_and_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_and_si128,__m128i,fgINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_and_spp1_SSE2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_and_si128,__m128i,fgINT32,_mm_set1_epi32);
#endif
}




void flgr1d_arith_const_or_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_or_si128,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_or_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_or_si128,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_or_spp1_SSE2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_or_si128,__m128i,fgUINT32,_mm_set1_epi32);
#endif
}
void flgr1d_arith_const_or_spp1_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_or_si128,__m128i,fgINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_or_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_or_si128,__m128i,fgINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_or_spp1_SSE2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_or_si128,__m128i,fgINT32,_mm_set1_epi32);
#endif
}




void flgr1d_arith_const_xor_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_xor_si128,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_xor_si128,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_xor_si128,__m128i,fgUINT32,_mm_set1_epi32);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_xor_si128,__m128i,fgINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_xor_si128,__m128i,fgINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_xor_spp1_SSE2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_xor_si128,__m128i,fgINT32,_mm_set1_epi32);
#endif
}




void flgr1d_arith_const_add_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_add_epi8,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_add_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_add_epi16,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_add_spp1_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_add_epi8,__m128i,fgINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_add_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_add_epi16,__m128i,fgINT16,_mm_set1_epi16);
#endif
}




void flgr1d_arith_const_addsat_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_adds_epu8,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_addsat_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_adds_epu16,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_addsat_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_adds_epi16,__m128i,fgINT16,_mm_set1_epi16);
#endif
}




void flgr1d_arith_const_sub_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_sub_epi8,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_sub_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_sub_epi16,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_sub_spp1_SSE2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_sub_epi8,__m128i,fgINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_sub_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_sub_epi16,__m128i,fgINT16,_mm_set1_epi16);
#endif
}




void flgr1d_arith_const_subsat_spp1_SSE2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_subs_epu8,__m128i,fgUINT8,_mm_set1_epi8);
#endif
}
void flgr1d_arith_const_subsat_spp1_SSE2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_subs_epu16,__m128i,fgUINT16,_mm_set1_epi16);
#endif
}
void flgr1d_arith_const_subsat_spp1_SSE2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
#ifdef __SSE2__
  FLGR_MACRO_ARITH_1D_DIADIC_CONST_SPP1_SSE2(_mm_subs_epi16,__m128i,fgINT16,_mm_set1_epi16);
#endif
}
